import { NodeStatus } from "../NodeStatus";
import { INode } from "../interfaces/INode";
import { ConditionNode } from "./ConditionNode";




/**
 * 简单条件节点
 */
export class SimpleConditionNode<T> extends ConditionNode<T> {


    protected tick_functor: (node: INode<T>) => NodeStatus;

    constructor(name: string, blackboard: T, tick_functor: (node: INode<T>) => NodeStatus) {
        super(name, blackboard);
        this.tick_functor = tick_functor;
    }

    Tick(): NodeStatus {
        return this.tick_functor(this);
    }
}